.class public Lcom/inmobi/androidsdk/impl/metric/Storage;
.super Ljava/lang/Object;
.source "Storage.java"


# static fields
.field public static final FILENAME_IN_CACHE:Ljava/lang/String; = "inmobi.cache.data"

.field public static final FILENAME_IN_CACHE_EVENTS:Ljava/lang/String; = "inmobi.cache.data.events.number"

.field public static final FILENAME_IN_CACHE_TS:Ljava/lang/String; = "inmobi.cache.data.events.timestamp"

.field static a:Ljava/util/concurrent/atomic/AtomicBoolean;

.field static b:Ljava/util/concurrent/atomic/AtomicBoolean;

.field private static c:Landroid/content/Context;

.field public static events:J

.field public static timestamp:J


# direct methods
.method static constructor <clinit>()V
    .locals 4

    .prologue
    const-wide/16 v2, -0x1

    const/4 v1, 0x0

    .line 23
    sput-wide v2, Lcom/inmobi/androidsdk/impl/metric/Storage;->events:J

    sput-wide v2, Lcom/inmobi/androidsdk/impl/metric/Storage;->timestamp:J

    .line 24
    new-instance v0, Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-direct {v0, v1}, Ljava/util/concurrent/atomic/AtomicBoolean;-><init>(Z)V

    sput-object v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->a:Ljava/util/concurrent/atomic/AtomicBoolean;

    .line 25
    new-instance v0, Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-direct {v0, v1}, Ljava/util/concurrent/atomic/AtomicBoolean;-><init>(Z)V

    sput-object v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->b:Ljava/util/concurrent/atomic/AtomicBoolean;

    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 16
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private static a(Landroid/content/Context;)V
    .locals 4
    .parameter

    .prologue
    .line 70
    :try_start_0
    const-string v0, "inmobi.cache.data.events.number"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, ""

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    sget-wide v2, Lcom/inmobi/androidsdk/impl/metric/Storage;->events:J

    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x0

    invoke-static {p0, v0, v1, v2}, Lcom/inmobi/commons/internal/FileOperations;->writeStringToFile(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Z)V

    .line 72
    const-string v0, "inmobi.cache.data.events.timestamp"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, ""

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    sget-wide v2, Lcom/inmobi/androidsdk/impl/metric/Storage;->timestamp:J

    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x0

    invoke-static {p0, v0, v1, v2}, Lcom/inmobi/commons/internal/FileOperations;->writeStringToFile(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Z)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 77
    :goto_0
    return-void

    .line 74
    :catch_0
    move-exception v0

    .line 75
    const-wide/16 v0, 0x0

    sput-wide v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->events:J

    goto :goto_0
.end method

.method public static readLocalCache(Landroid/content/Context;)Ljava/lang/String;
    .locals 1
    .parameter

    .prologue
    .line 29
    :try_start_0
    const-string v0, "inmobi.cache.data"

    invoke-static {p0, v0}, Lcom/inmobi/commons/internal/FileOperations;->readFileAsString(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    .line 33
    :goto_0
    return-object v0

    .line 31
    :catch_0
    move-exception v0

    .line 33
    const-string v0, "null,"

    goto :goto_0
.end method

.method public static readNumberOfEventsAndTimeStampFromPersistent(Landroid/content/Context;)V
    .locals 4
    .parameter

    .prologue
    const-wide/16 v2, -0x1

    .line 43
    sput-object p0, Lcom/inmobi/androidsdk/impl/metric/Storage;->c:Landroid/content/Context;

    .line 44
    sget-wide v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->events:J

    cmp-long v0, v0, v2

    if-eqz v0, :cond_1

    .line 60
    :cond_0
    :goto_0
    return-void

    .line 48
    :cond_1
    :try_start_0
    const-string v0, "inmobi.cache.data.events.number"

    invoke-static {p0, v0}, Lcom/inmobi/commons/internal/FileOperations;->readFileAsString(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v0

    sput-wide v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->events:J

    .line 50
    const-string v0, "inmobi.cache.data.events.timestamp"

    invoke-static {p0, v0}, Lcom/inmobi/commons/internal/FileOperations;->readFileAsString(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v0

    sput-wide v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->timestamp:J
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 56
    :goto_1
    sget-wide v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->timestamp:J

    cmp-long v0, v0, v2

    if-nez v0, :cond_0

    .line 57
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    const-wide/16 v2, 0x3e8

    div-long/2addr v0, v2

    sput-wide v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->timestamp:J

    .line 58
    sget-object v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->c:Landroid/content/Context;

    invoke-static {v0}, Lcom/inmobi/androidsdk/impl/metric/Storage;->a(Landroid/content/Context;)V

    goto :goto_0

    .line 52
    :catch_0
    move-exception v0

    .line 53
    const-wide/16 v0, 0x0

    sput-wide v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->events:J

    goto :goto_1
.end method

.method public static resetFile(Landroid/content/Context;)V
    .locals 4
    .parameter

    .prologue
    .line 121
    :try_start_0
    const-string v0, "inmobi.cache.data"

    const-string v1, ""

    const/4 v2, 0x0

    invoke-static {p0, v0, v1, v2}, Lcom/inmobi/commons/internal/FileOperations;->writeStringToFile(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Z)V

    .line 123
    const-wide/16 v0, 0x0

    sput-wide v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->events:J

    .line 124
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    const-wide/16 v2, 0x3e8

    div-long/2addr v0, v2

    sput-wide v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->timestamp:J

    .line 125
    invoke-static {p0}, Lcom/inmobi/androidsdk/impl/metric/Storage;->a(Landroid/content/Context;)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    .line 132
    :goto_0
    return-void

    .line 126
    :catch_0
    move-exception v0

    .line 127
    const-string v1, "InMobiAndroidSDK_3.7.0"

    const-string v2, "Someting went wrong while saving metrics log to persistent storage"

    invoke-static {v1, v2, v0}, Lcom/inmobi/commons/internal/Log;->internal(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    goto :goto_0
.end method

.method public static saveLocalCache(Landroid/content/Context;)V
    .locals 5
    .parameter

    .prologue
    const/4 v1, 0x1

    const/4 v4, 0x0

    .line 86
    sget-object v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->a:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {v0, v4, v1}, Ljava/util/concurrent/atomic/AtomicBoolean;->compareAndSet(ZZ)Z

    move-result v0

    if-nez v0, :cond_0

    .line 117
    :goto_0
    return-void

    .line 90
    :cond_0
    :try_start_0
    const-string v0, "inmobi.cache.data"

    sget-object v1, Lcom/inmobi/androidsdk/impl/metric/Queuer;->queuer:Lcom/inmobi/androidsdk/impl/metric/Queuer;

    invoke-virtual {v1}, Lcom/inmobi/androidsdk/impl/metric/Queuer;->get()Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x1

    invoke-static {p0, v0, v1, v2}, Lcom/inmobi/commons/internal/FileOperations;->writeStringToFile(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Z)V

    .line 93
    sget-wide v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->events:J

    sget-object v2, Lcom/inmobi/androidsdk/impl/metric/Queuer;->queuer:Lcom/inmobi/androidsdk/impl/metric/Queuer;

    iget-wide v2, v2, Lcom/inmobi/androidsdk/impl/metric/Queuer;->number:J

    add-long/2addr v0, v2

    sput-wide v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->events:J

    .line 94
    sget-object v0, Lcom/inmobi/androidsdk/impl/metric/Queuer;->queuer:Lcom/inmobi/androidsdk/impl/metric/Queuer;

    invoke-virtual {v0}, Lcom/inmobi/androidsdk/impl/metric/Queuer;->reset()V

    .line 95
    invoke-static {p0}, Lcom/inmobi/androidsdk/impl/metric/Storage;->a(Landroid/content/Context;)V

    .line 97
    sget-object v0, Lcom/inmobi/androidsdk/impl/metric/Logger;->action:Lcom/inmobi/androidsdk/impl/metric/MetricAction;
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1

    if-eqz v0, :cond_1

    .line 99
    :try_start_1
    sget-object v0, Lcom/inmobi/androidsdk/impl/metric/Logger;->action:Lcom/inmobi/androidsdk/impl/metric/MetricAction;

    invoke-interface {v0}, Lcom/inmobi/androidsdk/impl/metric/MetricAction;->fileWritten()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_2
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1

    .line 109
    :cond_1
    :goto_1
    sget-object v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->a:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {v0, v4}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V

    .line 111
    :try_start_2
    sget-object v1, Lcom/inmobi/androidsdk/impl/metric/Storage;->a:Ljava/util/concurrent/atomic/AtomicBoolean;

    monitor-enter v1
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    .line 112
    :try_start_3
    sget-object v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->a:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {v0}, Ljava/lang/Object;->notify()V

    .line 113
    monitor-exit v1

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit v1
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    :try_start_4
    throw v0
    :try_end_4
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_0

    .line 114
    :catch_0
    move-exception v0

    .line 115
    const-string v1, "InMobiAndroidSDK_3.7.0"

    const-string v2, "Error saving local cache"

    invoke-static {v1, v2, v0}, Lcom/inmobi/commons/internal/Log;->internal(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    goto :goto_0

    .line 102
    :catch_1
    move-exception v0

    .line 103
    const-string v1, "InMobiAndroidSDK_3.7.0"

    const-string v2, "Someting went wrong while saving metrics log to persistent storage"

    invoke-static {v1, v2, v0}, Lcom/inmobi/commons/internal/Log;->internal(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    goto :goto_1

    .line 100
    :catch_2
    move-exception v0

    goto :goto_1
.end method

.method public static saveToLatest()V
    .locals 1

    .prologue
    .line 200
    sget-object v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->c:Landroid/content/Context;

    invoke-static {v0}, Lcom/inmobi/androidsdk/impl/metric/Storage;->saveLocalCache(Landroid/content/Context;)V

    .line 201
    return-void
.end method

.method public static sendFile(Landroid/content/Context;)V
    .locals 7
    .parameter

    .prologue
    const/4 v2, 0x1

    const/4 v6, 0x0

    .line 136
    sget-object v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->b:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {v0, v6, v2}, Ljava/util/concurrent/atomic/AtomicBoolean;->compareAndSet(ZZ)Z

    move-result v0

    if-nez v0, :cond_1

    .line 197
    :goto_0
    return-void

    .line 142
    :cond_0
    :try_start_0
    sget-object v1, Lcom/inmobi/androidsdk/impl/metric/Storage;->a:Ljava/util/concurrent/atomic/AtomicBoolean;

    monitor-enter v1
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 143
    :try_start_1
    sget-object v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->a:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {v0}, Ljava/lang/Object;->wait()V

    .line 144
    monitor-exit v1
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 139
    :cond_1
    sget-object v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->a:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {v0, v6, v2}, Ljava/util/concurrent/atomic/AtomicBoolean;->compareAndSet(ZZ)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 152
    :try_start_2
    const-string v0, "InMobiAndroidSDK_3.7.0"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Sending "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    sget-wide v2, Lcom/inmobi/androidsdk/impl/metric/Storage;->events:J

    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, " events to server.."

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/inmobi/commons/internal/Log;->debug(Ljava/lang/String;Ljava/lang/String;)V

    .line 155
    invoke-static {p0}, Lcom/inmobi/androidsdk/impl/metric/Storage;->readLocalCache(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v0

    .line 156
    new-instance v1, Lorg/json/JSONObject;

    invoke-direct {v1}, Lorg/json/JSONObject;-><init>()V

    .line 157
    invoke-static {p0}, Lcom/inmobi/androidsdk/bootstrapper/Initializer;->getConfigParams(Landroid/content/Context;)Lcom/inmobi/androidsdk/bootstrapper/ConfigParams;

    move-result-object v2

    invoke-virtual {v2}, Lcom/inmobi/androidsdk/bootstrapper/ConfigParams;->getUID()Lcom/inmobi/commons/uid/UID;

    move-result-object v2

    invoke-static {p0, v2}, Lcom/inmobi/commons/uid/UIDUtil;->getMap(Landroid/content/Context;Lcom/inmobi/commons/uid/UID;)Ljava/util/Map;

    move-result-object v2

    invoke-static {v2, v1}, Lcom/inmobi/commons/uid/UIDUtil;->bindToJSON(Ljava/util/Map;Lorg/json/JSONObject;)V

    .line 161
    invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;

    move-result-object v2

    .line 162
    const-string v3, "tz"

    const/16 v4, 0xf

    invoke-virtual {v2, v4}, Ljava/util/Calendar;->get(I)I

    move-result v4

    invoke-virtual {v1, v3, v4}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;

    .line 163
    const-string v3, "ts"

    invoke-virtual {v2}, Ljava/util/Calendar;->getTimeInMillis()J

    move-result-wide v4

    invoke-virtual {v1, v3, v4, v5}, Lorg/json/JSONObject;->put(Ljava/lang/String;J)Lorg/json/JSONObject;

    .line 166
    invoke-virtual {v1}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v1

    .line 167
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const/4 v3, 0x0

    invoke-virtual {v1}, Ljava/lang/String;->length()I

    move-result v4

    add-int/lit8 v4, v4, -0x1

    invoke-virtual {v1, v3, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ","

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "\"payload\":["

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const/4 v2, 0x0

    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v3

    add-int/lit8 v3, v3, -0x1

    invoke-virtual {v0, v2, v3}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "]"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "}"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 171
    invoke-static {p0}, Lcom/inmobi/androidsdk/bootstrapper/Initializer;->getConfigParams(Landroid/content/Context;)Lcom/inmobi/androidsdk/bootstrapper/ConfigParams;

    move-result-object v1

    invoke-virtual {v1}, Lcom/inmobi/androidsdk/bootstrapper/ConfigParams;->getMetric()Lcom/inmobi/androidsdk/bootstrapper/MetricConfigParams;

    move-result-object v1

    invoke-virtual {v1}, Lcom/inmobi/androidsdk/bootstrapper/MetricConfigParams;->getUrl()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1, v0}, Lcom/inmobi/androidsdk/impl/metric/MetricEndPoint;->sendData(Ljava/lang/String;Ljava/lang/String;)V

    .line 174
    const-string v0, "InMobiAndroidSDK_3.7.0"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "data sent to url :"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-static {p0}, Lcom/inmobi/androidsdk/bootstrapper/Initializer;->getConfigParams(Landroid/content/Context;)Lcom/inmobi/androidsdk/bootstrapper/ConfigParams;

    move-result-object v2

    invoke-virtual {v2}, Lcom/inmobi/androidsdk/bootstrapper/ConfigParams;->getMetric()Lcom/inmobi/androidsdk/bootstrapper/MetricConfigParams;

    move-result-object v2

    invoke-virtual {v2}, Lcom/inmobi/androidsdk/bootstrapper/MetricConfigParams;->getUrl()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/inmobi/commons/internal/Log;->debug(Ljava/lang/String;Ljava/lang/String;)V

    .line 177
    invoke-static {p0}, Lcom/inmobi/androidsdk/impl/metric/Storage;->resetFile(Landroid/content/Context;)V

    .line 178
    sget-object v0, Lcom/inmobi/androidsdk/impl/metric/Logger;->action:Lcom/inmobi/androidsdk/impl/metric/MetricAction;
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    if-eqz v0, :cond_2

    .line 180
    :try_start_3
    sget-object v0, Lcom/inmobi/androidsdk/impl/metric/Logger;->action:Lcom/inmobi/androidsdk/impl/metric/MetricAction;

    invoke-interface {v0}, Lcom/inmobi/androidsdk/impl/metric/MetricAction;->fileSent()V
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_3

    .line 187
    :cond_2
    :goto_1
    sget-object v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->a:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {v0, v6}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V

    .line 190
    :try_start_4
    sget-object v1, Lcom/inmobi/androidsdk/impl/metric/Storage;->a:Ljava/util/concurrent/atomic/AtomicBoolean;

    monitor-enter v1
    :try_end_4
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_2

    .line 191
    :try_start_5
    sget-object v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->a:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {v0}, Ljava/lang/Object;->notify()V

    .line 192
    monitor-exit v1
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_1

    .line 196
    :goto_2
    sget-object v0, Lcom/inmobi/androidsdk/impl/metric/Storage;->b:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {v0, v6}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V

    goto/16 :goto_0

    .line 144
    :catchall_0
    move-exception v0

    :try_start_6
    monitor-exit v1
    :try_end_6
    .catchall {:try_start_6 .. :try_end_6} :catchall_0

    :try_start_7
    throw v0
    :try_end_7
    .catch Ljava/lang/Exception; {:try_start_7 .. :try_end_7} :catch_0

    .line 145
    :catch_0
    move-exception v0

    .line 146
    const-string v0, "InMobiAndroidSDK_3.7.0"

    const-string v1, "Unable to get lock for reading file before sending metric data"

    invoke-static {v0, v1}, Lcom/inmobi/commons/internal/Log;->debug(Ljava/lang/String;Ljava/lang/String;)V

    goto/16 :goto_0

    .line 183
    :catch_1
    move-exception v0

    .line 184
    const-string v0, "InMobiAndroidSDK_3.7.0"

    const-string v1, "Unable to send data"

    invoke-static {v0, v1}, Lcom/inmobi/commons/internal/Log;->debug(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1

    .line 192
    :catchall_1
    move-exception v0

    :try_start_8
    monitor-exit v1
    :try_end_8
    .catchall {:try_start_8 .. :try_end_8} :catchall_1

    :try_start_9
    throw v0
    :try_end_9
    .catch Ljava/lang/Exception; {:try_start_9 .. :try_end_9} :catch_2

    .line 193
    :catch_2
    move-exception v0

    goto :goto_2

    .line 181
    :catch_3
    move-exception v0

    goto :goto_1
.end method
